<?php
if (!defined('PHP_VERSION_ID')) {   # PHP_VERSION_ID is available as of PHP 5.2.7, if our
	$version = explode('.', PHP_VERSION); # version is lower than that, then emulate it
	define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
}

defined('APPLICATION_ENV') or define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'local'));

$configServer = include dirname(__FILE__) . '/protected/config/server.' . APPLICATION_ENV . '.php';
$configMain = include dirname(__FILE__) . '/protected/config/main.php';

require_once(YII_INCLUDE_PATH);

$config = CMap::mergeArray($configMain, $configServer);

$app = Yii::createWebApplication($config)->run();
